Skip to content

feat: implement issue #338 — [Fleet Monitor] petry-projects/.github-private — dev-lead.yml - #339

Merged
don-petry merged 3 commits into
mainfrom
dev-lead/issue-338-20260521-1004
May 21, 2026
Merged

don-petry merged 3 commits into
mainfrom
dev-lead/issue-338-20260521-1004

Conversation

@don-petry

Copy link
Copy Markdown
Collaborator

Closes #338

Implemented by dev-lead agent. Please review.

Copilot AI review requested due to automatic review settings May 21, 2026 10:18
@coderabbitai

coderabbitai Bot commented May 21, 2026 •

Copy link
Copy Markdown

Warning

Rate limit exceeded

@don-petry has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 56 minutes and 29 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: b765c32d-5052-4227-a618-0d42f5ed22db

📥 Commits

Reviewing files that changed from the base of the PR and between 1363ec0 and aad7043.

📒 Files selected for processing (3)
  • .github/workflows/dev-lead.yml
  • scripts/dev-lead-fix-issue.sh
  • tests/dev-lead/unit/test_fix_issue.bats
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev-lead/issue-338-20260521-1004

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — human-pr (no-changes)

No changes were needed for this PR.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (no-changes)

Engine ran but made no changes.

donpetry-bot
donpetry-bot previously approved these changes May 21, 2026

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: a7575c39d56dc30c81036c50853a982346fd3c14
Review mode: triage-approved (single reviewer)

Summary

This PR teaches dev-lead.yml to treat the engine's exit-code-2 ("all engines rate-limited") as a non-failure for the workflow, and adds matching rate-limit handling to scripts/dev-lead-fix-issue.sh so the issue intent now behaves like the already-converted fix-ci and fix-reviews intents. Two new bats tests cover the new branch. The change directly targets the cause of issue #338 (16.3% failure rate) — transient provider rate limits shouldn't count as workflow failures, since the retry cron already re-runs them.

Linked issue analysis

Issue #338 is a Fleet Monitor health alert flagging dev-lead.yml at 16.3% failure rate. The PR plausibly addresses the dominant failure mode (rate-limit exits from engine.sh) by:

  1. Wrapping each engine-running step so rc=2 → workflow exit 0.
  2. Adding parity rate-limit handling to dev-lead-fix-issue.sh, which previously only had exit 1 for any engine failure (so even rate-limits would have been counted).

This won't address non-rate-limit causes (real engine errors, timeouts, transient infra), but it's the right scoped fix for the metric.

Findings

No blockers.

Minor (non-blocking) observations:

  • The wrapper pattern [ "$rc" -eq 2 ] && exit 0 || exit "$rc" is repeated across seven steps. It's correct under set -eo pipefail (verified) but a small helper or a case would be slightly easier to read. Not worth fixing in this PR.
  • dev-lead-fix-issue.sh posts a rate-limited comment on the issue without the dedup check that dev-lead-fix-ci.sh uses for PRs (has_rate_limited_marker). Re-applying the dev-lead label while rate limits persist could post duplicate notices on the issue. Low-impact; can be tightened later if it becomes noisy.
  • The rm -f "$prompt_file" cleanup is duplicated in both the rate-limited and error branches. A trap-based cleanup would be tidier but isn't required.

CI status

All required checks succeeded: CodeQL, SonarCloud (Quality Gate passed, 0 new issues), shellcheck, bats unit tests, AgentShield, gitleaks, Agent Security Scan, and lint. Merge state is BLOCKED only because review approval is required.


Reviewed automatically by the PR-review agent (single-reviewer mode: opus 4.7). Reply if you need a human review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses Issue #338’s elevated failure rate for the dev-lead.yml workflow by treating “all engines rate-limited” as a non-failing outcome and adding explicit handling for rate-limits in the issue-fixing script.

Changes:

  • Update dev-lead-fix-issue.sh to distinguish rate-limit exhaustion (exit code 2) from real engine failures (exit code 1) and to post an issue comment when rate-limited.
  • Update dev-lead.yml steps to treat exit code 2 as a successful workflow outcome for relevant intents (fix-ci/fix-reviews/issue/etc.).
  • Add Bats unit tests covering rate-limit behavior for dev-lead-fix-issue.sh.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/dev-lead/unit/test_fix_issue.bats Adds unit tests verifying exit code 2 and issue-comment posting on rate-limit exhaustion.
scripts/dev-lead-fix-issue.sh Adds explicit handling for run_writer_with_fallback returning 2 (rate-limited) with an issue comment + exit 2.
.github/workflows/dev-lead.yml Wraps intent scripts so exit 2 (rate-limited) does not fail the workflow run.
Comments suppressed due to low confidence (1)

tests/dev-lead/unit/test_fix_issue.bats:229

  • This gh stub returns [] for the open-pulls query, but the script under test uses --jq ... | length and expects a numeric count (0). Returning 0 here would better match real gh api --jq output and avoid potential integer expression expected messages during the test run.
case "\$*" in
  *"pulls?state=open"*) echo "[]" ;;
  *"api"*"repos/"*"issues/"*) echo '{"title":"Test","body":"body"}' ;;
  *"api"*"users/"*) echo '{"id":12345}' ;;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/dev-lead/unit/test_fix_issue.bats Resolved

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements explicit rate-limit handling in the dev-lead-fix-issue.sh script, ensuring that when all engines are rate-limited, a comment is posted to the GitHub issue and the script exits with code 2. Corresponding unit tests have been added to validate this logic. Feedback suggests improving the user experience by including the specific rate-limit reset time in the issue comment, utilizing existing mechanisms to extract this timestamp.

Comment thread scripts/dev-lead-fix-issue.sh Resolved
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 21, 2026
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-reviews (applied)

Changes committed and pushed.

@don-petry
don-petry dismissed stale reviews from coderabbitai[bot] and donpetry-bot via b44e019 May 21, 2026 10:26
@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — human-pr (no-changes)

No changes were needed for this PR.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — fix-bot-comment (no-changes)

Engine ran but made no changes.

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: b44e01964bf5c0e97c02ce93442f1aae8eee30bb
Review mode: triage-approved (single reviewer)

Summary

Confirmation review of a triage-approved PR. The PR makes dev-lead.yml and scripts/dev-lead-fix-issue.sh treat engine exit-code-2 ("all engines rate-limited") as a non-failure, addressing the elevated failure rate flagged in issue #338. The new commit since the prior cascade review (b44e019) cleanly addresses two bot review comments without introducing new risk.

Linked issue analysis

Issue #338 is a Fleet Monitor health alert flagging dev-lead.yml at 16.3% failure rate. The PR plausibly addresses the dominant failure mode — transient rate-limit exits from engine.sh — by giving the issue intent the same exit-code-2 treatment that fix-ci and fix-reviews already have, and by wrapping the affected workflow steps so rc=2 exits the job as success. The retry cron picks them up later, so swallowing the rate-limit signal at the workflow level is the right scoped fix for this metric.

Findings

No blockers.

Incremental commit (b44e019) verified:

  • Gemini's suggestion (reset time in issue comment): Now reads /tmp/dev-lead-rate-limit-reset and appends The limit is expected to reset at <ts>. when present. Pattern matches scripts/dev-lead-fix-ci.sh:154 and scripts/dev-lead-fix-reviews.sh:263; the file is populated by parse_reset_time in scripts/engine.sh:347-381. Defensive: empty-string and missing-file cases both fall back cleanly.
  • Copilot's suggestion (bats stub returns numeric, not JSON array): Two stubs in tests/dev-lead/unit/test_fix_issue.bats now echo "0" instead of "[]". This matches real gh api --jq '... | length' output and avoids the integer expression expected failure mode the stub would have hit when feeding [] into [ "$existing" -gt 0 ].

No new concerns introduced. Prior cascade-review observations (repeated rc=2 wrapper, lack of dedup marker on the rate-limit issue comment, repeated rm -f cleanup) remain as low-impact polish items not worth blocking on.

CI status

All required checks succeeded: CodeQL, SonarCloud (Quality Gate passed, 0 new issues), shellcheck, bats, AgentShield, gitleaks, Agent Security Scan, lint, validate-agent-profiles, gh-aw-compile, Compile agentic workflows. mergeStateStatus is BLOCKED only because review approval is required.


Reviewed automatically by the PR-review agent (single-reviewer mode: opus 4.7). Reply if you need a human review.

@don-petry

Copy link
Copy Markdown
Collaborator Author

Dev-Lead — human-pr (no-changes)

No changes were needed for this PR.

@don-petry
don-petry enabled auto-merge (squash) May 21, 2026 11:34
@sonarqubecloud

Copy link
Copy Markdown

@don-petry
don-petry merged commit 0c1ddad into main May 21, 2026
26 checks passed
@don-petry
don-petry deleted the dev-lead/issue-338-20260521-1004 branch May 21, 2026 11:34

@donpetry-bot donpetry-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review — APPROVED ✓

Risk: LOW
Reviewed commit: aad7043747810db9554e7647fd7296e4fd8b9217
Review mode: triage-approved (single reviewer)

Summary

Confirmation review of a triage-approved PR. There are no functional changes since the prior cascade approval at b44e019 — the current head (aad7043) is a merge of main that brings in a single unrelated commit (1363ec0, "ci: use CLAUDE_CODE_OAUTH_TOKEN secret in ci-failure-analyst"), which touches only .github/workflows/ci-failure-analyst.lock.yml. None of the PR's own files (dev-lead.yml, scripts/dev-lead-fix-issue.sh, tests/dev-lead/unit/test_fix_issue.bats) were modified by the merge.

Linked issue analysis

Issue #338 is a Fleet Monitor health alert flagging dev-lead.yml at a 16.3% failure rate. The PR addresses the dominant failure mode — transient rate-limit exits from engine.sh — by giving the issue intent the same exit-code-2 treatment that fix-ci and fix-reviews already have, and by wrapping the affected workflow steps so rc=2 exits the job as success. The retry cron picks them up later, so swallowing the rate-limit signal at the workflow level is the correct scoped fix for the metric. This analysis stands unchanged from the prior review.

Findings

No blockers.

Delta since the previous review (b44e019 → aad7043):

  • Merge commit only. git compare shows one upstream commit (1363ec0) modifying .github/workflows/ci-failure-analyst.lock.yml — no overlap with this PR's changed files and no behavioural impact on the rate-limit handling under review.
  • All previously-noted low-impact polish items (repeated rc=2 wrapper pattern, no dedup marker on the rate-limit issue comment, duplicated rm -f cleanup) remain. Still not worth blocking on.

CI status

All required checks succeeded on the new head SHA: CodeQL, SonarCloud (Quality Gate passed, 0 new issues), shellcheck, bats, AgentShield, gitleaks, Agent Security Scan, lint, validate-agent-profiles, gh-aw-compile, Compile agentic workflows, PR Review Agent, Dev-Lead dispatch. reviewDecision is already APPROVED from the prior cycle; mergeStateStatus is UNKNOWN pending re-evaluation.


Reviewed automatically by the PR-review agent (single-reviewer mode: opus 4.7). Reply if you need a human review.

don-petry added a commit that referenced this pull request Jun 7, 2026
…rivate — dev-lead.yml (#339)

* feat: implement issue #338 — [Fleet Monitor] petry-projects/.github-private — dev-lead.yml

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
Co-authored-by: donpetry-bot <donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 7, 2026
…rivate — dev-lead.yml (#339)

* feat: implement issue #338 — [Fleet Monitor] petry-projects/.github-private — dev-lead.yml

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
Co-authored-by: donpetry-bot <donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 8, 2026
…rivate — dev-lead.yml (#339)

* feat: implement issue #338 — [Fleet Monitor] petry-projects/.github-private — dev-lead.yml

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
Co-authored-by: donpetry-bot <donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 12, 2026
…rivate — dev-lead.yml (#339)

* feat: implement issue #338 — [Fleet Monitor] petry-projects/.github-private — dev-lead.yml

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
Co-authored-by: donpetry-bot <donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 14, 2026
…rivate — dev-lead.yml (#339)

* feat: implement issue #338 — [Fleet Monitor] petry-projects/.github-private — dev-lead.yml

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
Co-authored-by: donpetry-bot <donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 18, 2026
…rivate — dev-lead.yml (#339)

* feat: implement issue #338 — [Fleet Monitor] petry-projects/.github-private — dev-lead.yml

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
Co-authored-by: donpetry-bot <donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 25, 2026
…rivate — dev-lead.yml (#339)

* feat: implement issue #338 — [Fleet Monitor] petry-projects/.github-private — dev-lead.yml

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
Co-authored-by: donpetry-bot <donpetry-bot@users.noreply.github.com>
don-petry added a commit that referenced this pull request Jun 25, 2026
…rivate — dev-lead.yml (#339)

* feat: implement issue #338 — [Fleet Monitor] petry-projects/.github-private — dev-lead.yml

* fix(reviews): address review comments [skip ci-relay]

---------

Co-authored-by: donpetry-bot <281750570+donpetry-bot@users.noreply.github.com>
Co-authored-by: donpetry-bot <donpetry-bot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fleet Monitor] petry-projects/.github-private — dev-lead.yml

3 participants